<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>onchange</title>
</head>
<body>
	<input type="checkbox">
	<!-- <input type="radio">
	<input type="text"> -->
	<select name="" id="">
		<option value="1">1</option>
		<option value="2">2</option>
		<option value="3">3</option>
		<option value="4">4</option>
		<option value="5">5</option>
		<option value="6">6</option>
		<option value="7">7</option>
	</select>
	<script>
		/*
			onchange 元素状态改变

			只有在状态改变时才会触发
		*/
		var check = document.getElementsByTagName('input')[0];
		var sel = document.getElementsByTagName('select')[0];
		sel.onchange = function(){
			console.log(this.value);
		}
		sel.onclick = function(){
			console.log(this.value);

		}
		check.onchange = function(){
			console.log(this.checked);
		}


	</script>
</body>
</html>